<template>
  <div class="gen-config">
    <a-form :labelCol="{ span: 4 }" :wrapperCol="{ span: 12 }">
      <a-form-item label="前端根目录">
        <a-flex>
          <a-input v-model:value="genStore.$state.gen.frontendRoot"></a-input>
        </a-flex>
      </a-form-item>
      <a-form-item label="后端根目录">
        <a-input v-model:value="genStore.$state.gen.backendRoot"></a-input>
      </a-form-item>
      <a-form-item label="包名">
        <a-input v-model:value="genStore.$state.gen.packageName"></a-input>
      </a-form-item>
      <a-form-item label="模块名">
        <a-input v-model:value="genStore.$state.gen.moduleName"></a-input>
      </a-form-item>
      <a-form-item label="父级ID">
        <a-tree-select
          :treeData="treeData"
          v-model:value="genStore.$state.gen.parentId"
          :field-names="{
            value: 'menuId',
            label: 'menuName',
          }"
        ></a-tree-select>
      </a-form-item>
    </a-form>
  </div>
</template>

<script setup lang="ts">
import { getParentMenus } from '@/api/modules/system/menu/utils';
import useSystemStore from '@/store/system';

const treeData = ref();

const genStore = useSystemStore();

onMounted(async () => {
  treeData.value = await getParentMenus();
});
</script>

<style lang="scss" scoped></style>
